package com.tdam2011;

import android.app.TabActivity;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Bundle;
import android.widget.TabHost;

public class HistorialCompleto extends TabActivity {

	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.historial_completo);

		Resources res = getResources();
		TabHost tabHost = getTabHost();
		TabHost.TabSpec spec;
		Intent intent;
		Bundle b = getIntent().getExtras();
		String contactoID = null;
		if (b.get("contactoID").equals("")){
			contactoID = null;
		}else{
			contactoID = (String) b.get("contactoID");
		}
		
		intent = new Intent().setClass(this, HistorialCompletoAccion.class);
		intent.putExtra("accion","Call");
		intent.putExtra("contactoID",contactoID);
		spec = tabHost
				.newTabSpec("llamadas")
				.setIndicator("Llamadas",
						res.getDrawable(R.drawable.ic_tab_llamadas))
				.setContent(intent);
		tabHost.addTab(spec);

		intent = new Intent().setClass(this, HistorialCompletoAccion.class);
		intent.putExtra("accion","SMS");
		intent.putExtra("contactoID",contactoID);
		spec = tabHost.newTabSpec("sms")
				.setIndicator("SMS", res.getDrawable(R.drawable.ic_tab_sms))
				.setContent(intent);
		tabHost.addTab(spec);

		intent = new Intent(this, HistorialCompletoAccion.class);
		intent.putExtra("accion","Email");
		intent.putExtra("contactoID",contactoID);
		spec = tabHost
				.newTabSpec("email")
				.setIndicator("E-mails",
						res.getDrawable(R.drawable.ic_tab_email))
				.setContent(intent);
		tabHost.addTab(spec);

		intent = new Intent(this, Preferencias.class);
		intent.putExtra("contactoID",contactoID);
		spec = tabHost
				.newTabSpec("web")
				.setIndicator("Mjs Web",
						res.getDrawable(R.drawable.ic_tab_web))
				.setContent(intent);
		tabHost.addTab(spec);

		tabHost.setCurrentTab(0);
	}

}